//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS DirectoryServiceData service.
///
///  Amazon Web Services Directory Service Data is an extension of Directory Service. This API reference provides detailed information about Directory Service Data operations and object types.  With Directory Service Data, you can create, read, update, and delete users, groups, and memberships from your Managed Microsoft AD without additional costs and without deploying dedicated management instances. You can also perform built-in object management tasks across directories without direct network connectivity, which simplifies provisioning and access management to achieve fully automated deployments. Directory Service Data supports user and group write operations, such as CreateUser and CreateGroup, within the organizational unit (OU) of your Managed Microsoft AD. Directory Service Data supports read operations, such as ListUsers and ListGroups, on all users, groups, and group memberships within your Managed Microsoft AD and across trusted realms. Directory Service Data supports adding and removing group members in your OU and the Amazon Web Services Delegated Groups OU, so you can grant and deny access to specific roles and permissions. For more information, see Manage users and groups in the Directory Service Administration Guide.   Directory management operations and configuration changes made against the Directory Service API will also reflect in Directory Service Data API with eventual consistency. You can expect a short delay between management changes, such as adding a new directory trust and calling the Directory Service Data API for the newly created trusted realm.   Directory Service Data connects to your Managed Microsoft AD domain controllers and performs operations on underlying directory objects. When you create your Managed Microsoft AD, you choose subnets for domain controllers that Directory Service creates on your behalf. If a domain controller is unavailable, Directory Service Data uses an available domain controller. As a result, you might notice eventual consistency while objects replicate from one domain controller to another domain controller. For more information, see What gets created in the Directory Service Administration Guide. Directory limits vary by Managed Microsoft AD edition:     Standard edition – Supports 8 transactions per second (TPS) for read operations and 4 TPS for write operations per directory. There's a concurrency limit of 10 concurrent requests.     Enterprise edition – Supports 16 transactions per second (TPS) for read operations and 8 TPS for write operations per directory. There's a concurrency limit of 10 concurrent requests.    Amazon Web Services Account - Supports a total of 100 TPS for Directory Service Data operations across all directories.   Directory Service Data only supports the Managed Microsoft AD directory type and is only available in the primary Amazon Web Services Region. For more information, see Managed Microsoft AD and Primary vs additional Regions in the Directory Service Administration Guide.
public struct DirectoryServiceData: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the DirectoryServiceData client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "DirectoryServiceData",
            serviceIdentifier: "ds-data",
            serviceProtocol: .restjson,
            apiVersion: "2023-05-31",
            endpoint: endpoint,
            errorType: DirectoryServiceDataErrorType.self,
            xmlNamespace: "http://directoryservicedata.amazonaws.com/doc/2023-05-31/",
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Adds an existing user, group, or computer as a group member.
    @Sendable
    @inlinable
    public func addGroupMember(_ input: AddGroupMemberRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AddGroupMemberResult {
        try await self.client.execute(
            operation: "AddGroupMember", 
            path: "/GroupMemberships/AddGroupMember", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds an existing user, group, or computer as a group member.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - groupName:  The name of the group.
    ///   - memberName:  The SAMAccountName of the user, group, or computer to add as a group member.
    ///   - memberRealm:  The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.   This parameter is case insensitive.
    ///   - logger: Logger use during operation
    @inlinable
    public func addGroupMember(
        clientToken: String? = AddGroupMemberRequest.idempotencyToken(),
        directoryId: String,
        groupName: String,
        memberName: String,
        memberRealm: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AddGroupMemberResult {
        let input = AddGroupMemberRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            groupName: groupName, 
            memberName: memberName, 
            memberRealm: memberRealm
        )
        return try await self.addGroupMember(input, logger: logger)
    }

    /// Creates a new group.
    @Sendable
    @inlinable
    public func createGroup(_ input: CreateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateGroupResult {
        try await self.client.execute(
            operation: "CreateGroup", 
            path: "/Groups/CreateGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new group.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - groupScope:  The scope of the AD group. For details, see Active Directory security group scope.
    ///   - groupType:  The AD group type. For details, see Active Directory security group type.
    ///   - otherAttributes:  An expression that defines one or more attributes with the data type and value of each attribute.
    ///   - samAccountName:  The name of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func createGroup(
        clientToken: String? = CreateGroupRequest.idempotencyToken(),
        directoryId: String,
        groupScope: GroupScope? = nil,
        groupType: GroupType? = nil,
        otherAttributes: [String: AttributeValue]? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateGroupResult {
        let input = CreateGroupRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            groupScope: groupScope, 
            groupType: groupType, 
            otherAttributes: otherAttributes, 
            samAccountName: samAccountName
        )
        return try await self.createGroup(input, logger: logger)
    }

    /// Creates a new user.
    @Sendable
    @inlinable
    public func createUser(_ input: CreateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateUserResult {
        try await self.client.execute(
            operation: "CreateUser", 
            path: "/Users/CreateUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new user.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that’s associated with the user.
    ///   - emailAddress:  The email address of the user.
    ///   - givenName:  The first name of the user.
    ///   - otherAttributes:  An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.   Attribute names are case insensitive.
    ///   - samAccountName:  The name of the user.
    ///   - surname:  The last name of the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func createUser(
        clientToken: String? = CreateUserRequest.idempotencyToken(),
        directoryId: String,
        emailAddress: String? = nil,
        givenName: String? = nil,
        otherAttributes: [String: AttributeValue]? = nil,
        samAccountName: String,
        surname: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateUserResult {
        let input = CreateUserRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            emailAddress: emailAddress, 
            givenName: givenName, 
            otherAttributes: otherAttributes, 
            samAccountName: samAccountName, 
            surname: surname
        )
        return try await self.createUser(input, logger: logger)
    }

    /// Deletes a group.
    @Sendable
    @inlinable
    public func deleteGroup(_ input: DeleteGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGroupResult {
        try await self.client.execute(
            operation: "DeleteGroup", 
            path: "/Groups/DeleteGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a group.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - samAccountName:  The name of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGroup(
        clientToken: String? = DeleteGroupRequest.idempotencyToken(),
        directoryId: String,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGroupResult {
        let input = DeleteGroupRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            samAccountName: samAccountName
        )
        return try await self.deleteGroup(input, logger: logger)
    }

    /// Deletes a user.
    @Sendable
    @inlinable
    public func deleteUser(_ input: DeleteUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteUserResult {
        try await self.client.execute(
            operation: "DeleteUser", 
            path: "/Users/DeleteUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a user.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - samAccountName:  The name of the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteUser(
        clientToken: String? = DeleteUserRequest.idempotencyToken(),
        directoryId: String,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteUserResult {
        let input = DeleteUserRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            samAccountName: samAccountName
        )
        return try await self.deleteUser(input, logger: logger)
    }

    /// Returns information about a specific group.
    @Sendable
    @inlinable
    public func describeGroup(_ input: DescribeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeGroupResult {
        try await self.client.execute(
            operation: "DescribeGroup", 
            path: "/Groups/DescribeGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about a specific group.
    ///
    /// Parameters:
    ///   - directoryId: The Identifier (ID) of the directory associated with the group.
    ///   - otherAttributes:  One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - samAccountName:  The name of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeGroup(
        directoryId: String,
        otherAttributes: [String]? = nil,
        realm: String? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeGroupResult {
        let input = DescribeGroupRequest(
            directoryId: directoryId, 
            otherAttributes: otherAttributes, 
            realm: realm, 
            samAccountName: samAccountName
        )
        return try await self.describeGroup(input, logger: logger)
    }

    /// Returns information about a specific user.
    @Sendable
    @inlinable
    public func describeUser(_ input: DescribeUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeUserResult {
        try await self.client.execute(
            operation: "DescribeUser", 
            path: "/Users/DescribeUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about a specific user.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - otherAttributes:  One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - realm:  The domain name that's associated with the user.   This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.  This value is case insensitive.
    ///   - samAccountName:  The name of the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeUser(
        directoryId: String,
        otherAttributes: [String]? = nil,
        realm: String? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeUserResult {
        let input = DescribeUserRequest(
            directoryId: directoryId, 
            otherAttributes: otherAttributes, 
            realm: realm, 
            samAccountName: samAccountName
        )
        return try await self.describeUser(input, logger: logger)
    }

    ///  Deactivates an active user account. For information about how to enable an inactive user account, see ResetUserPassword in the Directory Service API Reference.
    @Sendable
    @inlinable
    public func disableUser(_ input: DisableUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisableUserResult {
        try await self.client.execute(
            operation: "DisableUser", 
            path: "/Users/DisableUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Deactivates an active user account. For information about how to enable an inactive user account, see ResetUserPassword in the Directory Service API Reference.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - samAccountName:  The name of the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func disableUser(
        clientToken: String? = DisableUserRequest.idempotencyToken(),
        directoryId: String,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisableUserResult {
        let input = DisableUserRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            samAccountName: samAccountName
        )
        return try await self.disableUser(input, logger: logger)
    }

    ///  Returns member information for the specified group.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroupMembers.NextToken member contains a token that you pass in the next call to ListGroupMembers. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    @Sendable
    @inlinable
    public func listGroupMembers(_ input: ListGroupMembersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupMembersResult {
        try await self.client.execute(
            operation: "ListGroupMembers", 
            path: "/GroupMemberships/ListGroupMembers", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns member information for the specified group.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroupMembers.NextToken member contains a token that you pass in the next call to ListGroupMembers. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - memberRealm:  The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.   This parameter is optional and case insensitive.
    ///   - nextToken: An encoded paging token for paginated calls that can be passed back to retrieve the next page.
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - samAccountName:  The name of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroupMembers(
        directoryId: String,
        maxResults: Int? = nil,
        memberRealm: String? = nil,
        nextToken: String? = nil,
        realm: String? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupMembersResult {
        let input = ListGroupMembersRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            memberRealm: memberRealm, 
            nextToken: nextToken, 
            realm: realm, 
            samAccountName: samAccountName
        )
        return try await self.listGroupMembers(input, logger: logger)
    }

    ///  Returns group information for the specified directory.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroups.NextToken member contains a token that you pass in the next call to ListGroups. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    @Sendable
    @inlinable
    public func listGroups(_ input: ListGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupsResult {
        try await self.client.execute(
            operation: "ListGroups", 
            path: "/Groups/ListGroups", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns group information for the specified directory.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroups.NextToken member contains a token that you pass in the next call to ListGroups. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - nextToken:  An encoded paging token for paginated calls that can be passed back to retrieve the next page.
    ///   - realm:  The domain name associated with the directory.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroups(
        directoryId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        realm: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupsResult {
        let input = ListGroupsRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            realm: realm
        )
        return try await self.listGroups(input, logger: logger)
    }

    ///  Returns group information for the specified member.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroupsForMember.NextToken member contains a token that you pass in the next call to ListGroupsForMember. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    @Sendable
    @inlinable
    public func listGroupsForMember(_ input: ListGroupsForMemberRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupsForMemberResult {
        try await self.client.execute(
            operation: "ListGroupsForMember", 
            path: "/GroupMemberships/ListGroupsForMember", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns group information for the specified member.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroupsForMember.NextToken member contains a token that you pass in the next call to ListGroupsForMember. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the member.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - memberRealm:  The domain name that's associated with the group member.   This parameter is optional, so you can limit your results to the group members in a specific domain.  This parameter is case insensitive and defaults to Realm
    ///   - nextToken:  An encoded paging token for paginated calls that can be passed back to retrieve the next page.
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive and defaults to your Managed Microsoft AD domain.
    ///   - samAccountName:  The SAMAccountName of the user, group, or computer that's a member of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroupsForMember(
        directoryId: String,
        maxResults: Int? = nil,
        memberRealm: String? = nil,
        nextToken: String? = nil,
        realm: String? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupsForMemberResult {
        let input = ListGroupsForMemberRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            memberRealm: memberRealm, 
            nextToken: nextToken, 
            realm: realm, 
            samAccountName: samAccountName
        )
        return try await self.listGroupsForMember(input, logger: logger)
    }

    ///  Returns user information for the specified directory.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListUsers.NextToken member contains a token that you pass in the next call to ListUsers. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    @Sendable
    @inlinable
    public func listUsers(_ input: ListUsersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListUsersResult {
        try await self.client.execute(
            operation: "ListUsers", 
            path: "/Users/ListUsers", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Returns user information for the specified directory.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListUsers.NextToken member contains a token that you pass in the next call to ListUsers. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - nextToken:  An encoded paging token for paginated calls that can be passed back to retrieve the next page.
    ///   - realm:  The domain name that's associated with the user.   This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.  This value is case insensitive.
    ///   - logger: Logger use during operation
    @inlinable
    public func listUsers(
        directoryId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        realm: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListUsersResult {
        let input = ListUsersRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            realm: realm
        )
        return try await self.listUsers(input, logger: logger)
    }

    ///  Removes a member from a group.
    @Sendable
    @inlinable
    public func removeGroupMember(_ input: RemoveGroupMemberRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RemoveGroupMemberResult {
        try await self.client.execute(
            operation: "RemoveGroupMember", 
            path: "/GroupMemberships/RemoveGroupMember", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Removes a member from a group.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the member.
    ///   - groupName:  The name of the group.
    ///   - memberName:  The SAMAccountName of the user, group, or computer to remove from the group.
    ///   - memberRealm:  The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.   This parameter is optional and case insensitive.
    ///   - logger: Logger use during operation
    @inlinable
    public func removeGroupMember(
        clientToken: String? = RemoveGroupMemberRequest.idempotencyToken(),
        directoryId: String,
        groupName: String,
        memberName: String,
        memberRealm: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RemoveGroupMemberResult {
        let input = RemoveGroupMemberRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            groupName: groupName, 
            memberName: memberName, 
            memberRealm: memberRealm
        )
        return try await self.removeGroupMember(input, logger: logger)
    }

    ///  Searches the specified directory for a group. You can find groups that match the SearchString parameter with the value of their attributes included in the SearchString parameter.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchGroups.NextToken member contains a token that you pass in the next call to SearchGroups. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    @Sendable
    @inlinable
    public func searchGroups(_ input: SearchGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SearchGroupsResult {
        try await self.client.execute(
            operation: "SearchGroups", 
            path: "/Groups/SearchGroups", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Searches the specified directory for a group. You can find groups that match the SearchString parameter with the value of their attributes included in the SearchString parameter.  This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchGroups.NextToken member contains a token that you pass in the next call to SearchGroups. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - nextToken:  An encoded paging token for paginated calls that can be passed back to retrieve the next page.
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - searchAttributes:  One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - searchString:  The attribute value that you want to search for.   Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - logger: Logger use during operation
    @inlinable
    public func searchGroups(
        directoryId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        realm: String? = nil,
        searchAttributes: [String],
        searchString: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SearchGroupsResult {
        let input = SearchGroupsRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            realm: realm, 
            searchAttributes: searchAttributes, 
            searchString: searchString
        )
        return try await self.searchGroups(input, logger: logger)
    }

    ///  Searches the specified directory for a user. You can find users that match the SearchString parameter with the value of their attributes included in the SearchString parameter. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchUsers.NextToken member contains a token that you pass in the next call to SearchUsers. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    @Sendable
    @inlinable
    public func searchUsers(_ input: SearchUsersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SearchUsersResult {
        try await self.client.execute(
            operation: "SearchUsers", 
            path: "/Users/SearchUsers", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Searches the specified directory for a user. You can find users that match the SearchString parameter with the value of their attributes included in the SearchString parameter. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchUsers.NextToken member contains a token that you pass in the next call to SearchUsers. This retrieves the next set of items.  You can also specify a maximum number of return results with the MaxResults parameter.
    ///
    /// Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - nextToken:  An encoded paging token for paginated calls that can be passed back to retrieve the next page.
    ///   - realm:  The domain name that's associated with the user.   This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.  This value is case insensitive.
    ///   - searchAttributes:  One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - searchString:  The attribute value that you want to search for.   Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - logger: Logger use during operation
    @inlinable
    public func searchUsers(
        directoryId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        realm: String? = nil,
        searchAttributes: [String],
        searchString: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SearchUsersResult {
        let input = SearchUsersRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            realm: realm, 
            searchAttributes: searchAttributes, 
            searchString: searchString
        )
        return try await self.searchUsers(input, logger: logger)
    }

    ///  Updates group information.
    @Sendable
    @inlinable
    public func updateGroup(_ input: UpdateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateGroupResult {
        try await self.client.execute(
            operation: "UpdateGroup", 
            path: "/Groups/UpdateGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Updates group information.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - groupScope:  The scope of the AD group. For details, see Active Directory security groups.
    ///   - groupType:  The AD group type. For details, see Active Directory security group type.
    ///   - otherAttributes:  An expression that defines one or more attributes with the data type and the value of each attribute.
    ///   - samAccountName:  The name of the group.
    ///   - updateType:  The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateGroup(
        clientToken: String? = UpdateGroupRequest.idempotencyToken(),
        directoryId: String,
        groupScope: GroupScope? = nil,
        groupType: GroupType? = nil,
        otherAttributes: [String: AttributeValue]? = nil,
        samAccountName: String,
        updateType: UpdateType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateGroupResult {
        let input = UpdateGroupRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            groupScope: groupScope, 
            groupType: groupType, 
            otherAttributes: otherAttributes, 
            samAccountName: samAccountName, 
            updateType: updateType
        )
        return try await self.updateGroup(input, logger: logger)
    }

    ///  Updates user information.
    @Sendable
    @inlinable
    public func updateUser(_ input: UpdateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateUserResult {
        try await self.client.execute(
            operation: "UpdateUser", 
            path: "/Users/UpdateUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Updates user information.
    ///
    /// Parameters:
    ///   - clientToken:  A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.  A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.  If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.   This parameter is optional when using the CLI or SDK.
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - emailAddress:  The email address of the user.
    ///   - givenName:  The first name of the user.
    ///   - otherAttributes:  An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.   Attribute names are case insensitive.
    ///   - samAccountName:  The name of the user.
    ///   - surname:  The last name of the user.
    ///   - updateType:  The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateUser(
        clientToken: String? = UpdateUserRequest.idempotencyToken(),
        directoryId: String,
        emailAddress: String? = nil,
        givenName: String? = nil,
        otherAttributes: [String: AttributeValue]? = nil,
        samAccountName: String,
        surname: String? = nil,
        updateType: UpdateType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateUserResult {
        let input = UpdateUserRequest(
            clientToken: clientToken, 
            directoryId: directoryId, 
            emailAddress: emailAddress, 
            givenName: givenName, 
            otherAttributes: otherAttributes, 
            samAccountName: samAccountName, 
            surname: surname, 
            updateType: updateType
        )
        return try await self.updateUser(input, logger: logger)
    }
}

extension DirectoryServiceData {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: DirectoryServiceData, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension DirectoryServiceData {
    /// Return PaginatorSequence for operation ``listGroupMembers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupMembersPaginator(
        _ input: ListGroupMembersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupMembersRequest, ListGroupMembersResult> {
        return .init(
            input: input,
            command: self.listGroupMembers,
            inputKey: \ListGroupMembersRequest.nextToken,
            outputKey: \ListGroupMembersResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroupMembers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - memberRealm:  The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.   This parameter is optional and case insensitive.
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - samAccountName:  The name of the group.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupMembersPaginator(
        directoryId: String,
        maxResults: Int? = nil,
        memberRealm: String? = nil,
        realm: String? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupMembersRequest, ListGroupMembersResult> {
        let input = ListGroupMembersRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            memberRealm: memberRealm, 
            realm: realm, 
            samAccountName: samAccountName
        )
        return self.listGroupMembersPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsPaginator(
        _ input: ListGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupsRequest, ListGroupsResult> {
        return .init(
            input: input,
            command: self.listGroups,
            inputKey: \ListGroupsRequest.nextToken,
            outputKey: \ListGroupsResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - realm:  The domain name associated with the directory.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsPaginator(
        directoryId: String,
        maxResults: Int? = nil,
        realm: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupsRequest, ListGroupsResult> {
        let input = ListGroupsRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            realm: realm
        )
        return self.listGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listGroupsForMember(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsForMemberPaginator(
        _ input: ListGroupsForMemberRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupsForMemberRequest, ListGroupsForMemberResult> {
        return .init(
            input: input,
            command: self.listGroupsForMember,
            inputKey: \ListGroupsForMemberRequest.nextToken,
            outputKey: \ListGroupsForMemberResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroupsForMember(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the member.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - memberRealm:  The domain name that's associated with the group member.   This parameter is optional, so you can limit your results to the group members in a specific domain.  This parameter is case insensitive and defaults to Realm
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive and defaults to your Managed Microsoft AD domain.
    ///   - samAccountName:  The SAMAccountName of the user, group, or computer that's a member of the group.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsForMemberPaginator(
        directoryId: String,
        maxResults: Int? = nil,
        memberRealm: String? = nil,
        realm: String? = nil,
        samAccountName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupsForMemberRequest, ListGroupsForMemberResult> {
        let input = ListGroupsForMemberRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            memberRealm: memberRealm, 
            realm: realm, 
            samAccountName: samAccountName
        )
        return self.listGroupsForMemberPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listUsers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listUsersPaginator(
        _ input: ListUsersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListUsersRequest, ListUsersResult> {
        return .init(
            input: input,
            command: self.listUsers,
            inputKey: \ListUsersRequest.nextToken,
            outputKey: \ListUsersResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listUsers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - realm:  The domain name that's associated with the user.   This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.  This value is case insensitive.
    ///   - logger: Logger used for logging
    @inlinable
    public func listUsersPaginator(
        directoryId: String,
        maxResults: Int? = nil,
        realm: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListUsersRequest, ListUsersResult> {
        let input = ListUsersRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            realm: realm
        )
        return self.listUsersPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``searchGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func searchGroupsPaginator(
        _ input: SearchGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<SearchGroupsRequest, SearchGroupsResult> {
        return .init(
            input: input,
            command: self.searchGroups,
            inputKey: \SearchGroupsRequest.nextToken,
            outputKey: \SearchGroupsResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``searchGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the group.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - realm:  The domain name that's associated with the group.   This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.  This value is case insensitive.
    ///   - searchAttributes:  One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - searchString:  The attribute value that you want to search for.   Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - logger: Logger used for logging
    @inlinable
    public func searchGroupsPaginator(
        directoryId: String,
        maxResults: Int? = nil,
        realm: String? = nil,
        searchAttributes: [String],
        searchString: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<SearchGroupsRequest, SearchGroupsResult> {
        let input = SearchGroupsRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            realm: realm, 
            searchAttributes: searchAttributes, 
            searchString: searchString
        )
        return self.searchGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``searchUsers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func searchUsersPaginator(
        _ input: SearchUsersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<SearchUsersRequest, SearchUsersResult> {
        return .init(
            input: input,
            command: self.searchUsers,
            inputKey: \SearchUsersRequest.nextToken,
            outputKey: \SearchUsersResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``searchUsers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - directoryId:  The identifier (ID) of the directory that's associated with the user.
    ///   - maxResults:  The maximum number of results to be returned per request.
    ///   - realm:  The domain name that's associated with the user.   This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.  This value is case insensitive.
    ///   - searchAttributes:  One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - searchString:  The attribute value that you want to search for.   Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.
    ///   - logger: Logger used for logging
    @inlinable
    public func searchUsersPaginator(
        directoryId: String,
        maxResults: Int? = nil,
        realm: String? = nil,
        searchAttributes: [String],
        searchString: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<SearchUsersRequest, SearchUsersResult> {
        let input = SearchUsersRequest(
            directoryId: directoryId, 
            maxResults: maxResults, 
            realm: realm, 
            searchAttributes: searchAttributes, 
            searchString: searchString
        )
        return self.searchUsersPaginator(input, logger: logger)
    }
}

extension DirectoryServiceData.ListGroupMembersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> DirectoryServiceData.ListGroupMembersRequest {
        return .init(
            directoryId: self.directoryId,
            maxResults: self.maxResults,
            memberRealm: self.memberRealm,
            nextToken: token,
            realm: self.realm,
            samAccountName: self.samAccountName
        )
    }
}

extension DirectoryServiceData.ListGroupsForMemberRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> DirectoryServiceData.ListGroupsForMemberRequest {
        return .init(
            directoryId: self.directoryId,
            maxResults: self.maxResults,
            memberRealm: self.memberRealm,
            nextToken: token,
            realm: self.realm,
            samAccountName: self.samAccountName
        )
    }
}

extension DirectoryServiceData.ListGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> DirectoryServiceData.ListGroupsRequest {
        return .init(
            directoryId: self.directoryId,
            maxResults: self.maxResults,
            nextToken: token,
            realm: self.realm
        )
    }
}

extension DirectoryServiceData.ListUsersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> DirectoryServiceData.ListUsersRequest {
        return .init(
            directoryId: self.directoryId,
            maxResults: self.maxResults,
            nextToken: token,
            realm: self.realm
        )
    }
}

extension DirectoryServiceData.SearchGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> DirectoryServiceData.SearchGroupsRequest {
        return .init(
            directoryId: self.directoryId,
            maxResults: self.maxResults,
            nextToken: token,
            realm: self.realm,
            searchAttributes: self.searchAttributes,
            searchString: self.searchString
        )
    }
}

extension DirectoryServiceData.SearchUsersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> DirectoryServiceData.SearchUsersRequest {
        return .init(
            directoryId: self.directoryId,
            maxResults: self.maxResults,
            nextToken: token,
            realm: self.realm,
            searchAttributes: self.searchAttributes,
            searchString: self.searchString
        )
    }
}
